<?php
if ($this->admin == TRUE) {
	$this->admin = '<li><a href="/admin">Admin</a></li>';
}
$this->placeholder ( 'title' )->set ( 'Atribuir Tarefa' );
$this->placeholder ( 'cal' )->set ( '<link rel="stylesheet" type="text/css" media="screen" href="/css/dashboard.css" />
<script type="text/javascript" src="/js/mootools.js"></script>
<script type="text/javascript" src="/js/calendar.js"></script>
<script type="text/javascript">		
	//<![CDATA[
		window.addEvent(\'domready\', function() { 
			myCal1 = new Calendar({ date_new_task: \'Y-m-d\' }, { classes: [\'dashboard\']});
		});
	//]]>
	</script>' )

;
$this->placeholder ( 'menu' )->set ( 

'<div id="menu">
		<ul>
			<li><a href="/tasks">Tarefas</a></li>
			<li class="active"><a href="/tasks/new">Atribuir Tarefa</a></li>
			<li><a href="/tasks/get">Tarefas Atribuídas</a></li>
			<li><a href="/tasks/active">Tarefas Activas</a></li>
			<li><a href="/tasks/closed">Tarefas Terminadas</a></li>
			' . $this->admin . '
			<li><a href="/logout">' . App_Icons::getIcon ( 'Exit', '/images/exit.png' ) . 'Sair</a></li>
		</ul>
	</div>' );

if ($this->errors) {
	echo '<br /><div class="entry">';
	
	$error = new App_Messages ( );
	$error->setMessageType ( 'error' );
	$error->setMessage ( 'Ocorreu um erro. As credenciais fornecidas n&atilde;o est&atilde;o correctas. Por favor tente de novo.' );
	echo $error->displayMessage ();
	
	echo $this->form->render ();
	echo '</div>';
} else {
	
	echo App_Icons::getIconTable ( 'Novo', '/images/new.png', 'Nova Tarefa' );
	echo '<br /><div class="entry">';
	echo $this->form->render ();
	echo '</div>';
}
